import type {RouteRecordRaw} from 'vue-router';

const routes: RouteRecordRaw[] = [
    {
        path: '/login',
        name: 'Login',
        component: () => import("@/views/login/index.vue"),
        meta: {
            title: "苍穹外卖",
            hidden: true,
            notNeedAuth: true
        }
    },
    {
        path: "/404",
        name: "404",
        component: () => import("@/views/404/index.vue"),
        meta: {
            title: "苍穹外卖",
            hidden: true,
            notNeedAuth: true,
        }
    },
    {
        path: "/",
        component: () => import("@/layout/index.vue"),
        redirect: "/dashboard",
        children: [
            {
                path: "dashboard",
                name: "Dashboard",
                component: () => import("@/views/dashboard/index.vue"),
                meta: {
                    title: "工作台",
                    icon: "dashboard",
                    affix: true
                }
            },
            {
                path: "/statistics",
                component: () => import("@/views/statistics/index.vue"),
                meta: {
                    title: "数据统计",
                    icon: "icon-statistics"
                }
            },
            {
                path: "order",
                component: () => import("@/views/orderDetails/index.vue"),
                meta: {
                    title: "订单管理",
                    icon: "icon-order"
                }
            },
            {
                path: "setmeal",
                component: () => import("@/views/setmeal/index.vue"),
                meta: {
                    title: "套餐管理",
                    icon: "icon-combo"
                },
                children: [
                    {
                        path: "add",
                        component: () => import("@/views/setmeal/add/index.vue"),
                        meta: {
                            title: "添加套餐",
                            hidden: true
                        }
                    }
                ]
            },
            {
                path: "dish",
                component: () => import("@/views/dish/index.vue"),
                meta: {
                    title: "菜品管理",
                    icon: "icon-dish"
                },
                children: [
                    {
                        path: "add",
                        component: () => import("@/views/dish/add/index.vue"),
                        meta: {
                            title: "添加菜品",
                            hidden: true
                        }
                    },
                ]
            },
            {
                path: "category",
                component: () => import("@/views/category/index.vue"),
                meta: {
                    title: "分类管理",
                    icon: "icon-category"
                }
            },
            {
                path: "employee",
                component: () => import("@/views/employee/index.vue"),
                meta: {
                    title: "员工管理",
                    icon: "icon-employee"
                },
                children: [
                    {
                        path: "add",
                        component: () => import("@/views/employee/add/index.vue"),
                        meta: {
                            title: "添加员工",
                            hidden: true
                        }
                    },
                ]
            }
        ]
    }
]

export default routes;